<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-title">
                <h4>客户留言</h4>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <form method="post" id="form-list" action="index.php?r=plugins/message">
                        <input type="hidden" name="page">
                        <table class="table table-bordered ">
                            <thead>
                            <tr>
                                <th scope="col" width="20%">姓名</th>
                                <th scope="col" width="40%" >内容</th>
                                <th scope="col" width="20%" >邮件</th>
                                <th scope="col" width="20%" >时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php
                            foreach ($messages as $message) {
                                ?>
                                <tr>
                                    <td><?php echo $message['cname']; ?></td>
                                    <td><?php echo $message['content'] ?></td>
                                    <td><?php echo $message['email']; ?></td>
                                    <td><?php echo $message['createtime']; ?></td>
                                </tr>
                                <?php
                            }
                            ?>
                            </tbody>
                        </table>
                    </form>
                </div>

                <div class="text-center m-t-10 m-b-10">
                    <div style="display: inline-block;">
                        <?php
                        $this->widget('RKCLinkPager', array(
                                'header' => '',
                                'firstPageLabel' =>'<i class="fa fa-angle-double-left" ></i>',
                                'lastPageLabel' => '<i class="fa fa-angle-double-right" ></i>',
                                'prevPageLabel' => '<i class="fa fa-angle-left" ></i>',
                                'nextPageLabel' => '<i class="fa fa-angle-right" ></i>',
                                'pages' => $pager,
                                "selectedPageCssClass"=>'active',
                                'htmlOptions' => Array('class' => 'pagination')
                            )
                        );
                        ?>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script>
    function linkPager(page) {
        $("input[name=page]").val(page);
        $("#form-list").submit();
    }
</script>